<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>大灰灰共享单车后台管理系统</title>
    <!-- ZUI 标准版压缩后的 CSS 文件 -->
    <link href="/admin/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="/admin/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="/admin/css/animate.min.css" rel="stylesheet">
    <link href="/admin/css/style.min862f.css?v=4.1.0" rel="stylesheet">

    <!-- IE8兼容性处理代码  begin-->
    <!--[if lt IE 9]>
    <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <!-- Respond.js proxy on external server -->
    <link href="http://externalcdn.com/respond-proxy.html" id="respond-proxy" rel="respond-proxy"/>
    <!-- Respond.js redirect location on local server -->
    <link href="/admin/ie/respond.proxy.gif" id="respond-redirect" rel="respond-redirect"/>
    <!-- Respond.js proxy script on local server -->
    <!--   <script src="../ie/respond.proxy.js"></script>-->
    <!-- IE8兼容性处理代码  end -->
    <script src="/admin/frame/jquery/jquery-1.9.1.min.js"></script>
    <!-- ZUI 标准版压缩后的 JavaScript 文件 -->
    <script src="/admin/frame/bootstrap/js/bootstrap.min.js"></script>
    <style type="text/css">
        body{
            background: url("/admin/img/bg.png");
        }
    </style>
</head>
<body>
<div class="container-fluid">
    <div class="modal fade in" style="display: block;margin-top: 120px;">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h4 class="modal-title">欢迎使用大灰灰共享单车后台管理系统</h4>
                </div>
                <div class="modal-body">
                    <form class="form-horizontal" id="login_form">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">用户名：</label>
                            <div class="col-sm-10">
                                <input type="email" name="identity" class="form-control" placeholder="请输入用户名">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">密码：</label>
                            <div class="col-sm-10">
                                <input type="password" name="token" class="form-control " placeholder="请输入用户密码">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">验证码：</label>
                            <div class="col-sm-4">
                                <input type="text" name="identifyCode" class="form-control" placeholder="验证码">
                            </div>
                            <div class="col-sm-4">
                                <img id="imgVerification" src="/System/imgVerification" width="80" height="30">
                            </div>
                        </div>
                    </form>
                    <div class="modal-footer">
                        <div class="col-sm-offset-2 col-sm-8">
                            <button id="login_btn" type="button" class="btn btn-primary" style="width: 100%">立即登录</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script src="/admin/frame/layer/layer.js"></script>
<script type="text/javascript" src="/admin/js/myPlug.js"></script>


<script type="text/javascript">
    $("#imgVerification").on("click",function () {
        $(this).attr("src","/System/imgVerification?"+Math.random());
    });
    $("#login_btn").on("click",function(){
        var data=$("#login_form").serializeJson();
        $.ajax({
            beforeSend: function () {
                var index = layer.load(2, {
                    shade: [0.1, '#fff'] //0.1透明度的白色背景
                });
            }, complete: function () {
                layer.closeAll("loading");
            },
            cache: true,
            type: "POST",
            url: "/Admin/Base/BaseUser/userLogin",
            data: data,
            async: false,
            error: function (request) {
                layer.closeAll("loading");
                layer.alert('提交失败，请检查网络信息！', {
                    skin: 'layui-layer-molv'
                    , closeBtn: 0
                    , title: '错误信息'
                    , anim: 0 //动画类型
                    , zIndex: layer.zIndex
                });
            },
            success: function (msg) {
                layer.msg(msg.msg);
                if(!msg.state)
                {
                    $("#imgVerification").attr("src","/System/imgVerification?"+Math.random());
                }else{
                    window.location.href="/Admin/home";
                }
            }
        });
    });
</script>
</html>
